<?php
function smarty_function_article_view($params, &$smarty)
{
	include($_ENV['webpath']."conn.php");
	$sqladd='';
	$id=$params['id']?$params['id']:$_GET['id'];

	if($id){
		$sql="select * from ".$prefix."article where id=".$id;
		$result=mysql_query($sql);
		if($row=mysql_fetch_array($result)){
			$row['content']=stripslashes($row['content']);
			$arr=$row;
		}
	}
	
	if (empty($params['assign'])) {
		return $arr;
	} else {
		$smarty->assign($params['assign'],$arr);
	}
	mysql_close($conn);
}
?>
